{template header}
<link rel="stylesheet" media="all" href="{SITE_URL}static/css/widescreen/css/greendetail.css?v1.1" />
<link rel="stylesheet" media="all" href="{SITE_URL}static/css/widescreen/css/course.css" />
<style>
	.searchbox {
    width: 546px;
    height: 34px;
    float: right;
    position: relative;
    margin-top: -4px;
    z-index: 2;
}
header nav {
    height: 56px;
    margin: 0 70px;
    position: relative;
    left: -10px;
    top: -20px;
}
.searchbox .ask {
    display: inline-block;
    width: 58px;
    height: 34px;
    background: #0085ee;
    color: #fff;
    font: 14px/34px "Microsoft YaHei";
    text-align: center;
    position: absolute;
    top: 0;
    right: 210px;
    border-radius: 3px;
    -webkit-border-radius: 3px;
}
#body,.main-wrapper{
	padding:0px;
	margin: 0px;
}
#footer{
	margin: 0px;
	
}
.side-box .box-body ul>li>a{
	padding-left: 0px;
}
</style>
<div class="body">
       {eval $_tmpcatid=$category['pid'];}
                                           
                                              {eval $_tmpcat=$this->category[$_tmpcatid];}
                                         {if $_tmpcat['pid']!=0}
                                           {eval $_tmpcatid=$_tmpcat['pid'];}
                                     
                                           
                                           {else}
                                           {eval $_tmpcatid=$category['id'];}
                                           {/if}
<div class="container">
    <div class="row">
        <div class="col-md-24">
             <div>
                 <div  class="base-breadcrumb course-bread-crumb" >
                     <ol class="breadcrumb">
                         <li class="breadcrumb-item">
                             <a href="{eval echo getcaturl($_tmpcatid,'topic/catlist/#id#');}" class="" target="_self">全部课程</a>
                         </li>
                         <li class="breadcrumb-item">
                             <a href="{eval echo getcaturl($topicone['articleclassid'],'topic/catlist/#id#');}" class="" target="_self">{$category['name']}</a>
                         </li>
                         <li class="breadcrumb-item active">
                             <span >{$topicone['title']}</span>
                         </li>
                     </ol>
                 </div>



             </div>

        </div>
        <div class="col-md-18">
            <div class="">
                <div class="common-content">
                    <div>
                        <div class="course-info-box">
                            <div class="info-box-top course-info-container">
                                <div class="course-info-header vertical-center">
                                    <div class="info-header-left vertical-center">
                                        <h4 class="course-info-name course-name inline-block">
                                           {$topicone['title']}
                                        </h4>
                                        {if $topicone['price']==0}
                                        <span  class="course-info-type course-type-tag inline-block free">
        免费
      </span>
      {/if}

          {if $topicone['price']>0}
  <span class="course-info-type course-type-tag inline-block bootcamp">
        购买
      </span> {/if}
                                    </div>
                                    <div class="info-header-right hidden-sm hidden-xs">
                                    {if $isfollowarticle}
                                        <div class="course-follow-wrapper vertical-center followcourse{$topicone['id']}"  onclick="window.location.href='{url favorite/delfavoratearticle/$tid}'">
                                            <span class="f_cname">已关注</span>
                                            <span  class="btn-action-follow">
                                                <i class="fa fa-star-follow fa-star followed" ></i>
                                            </span>
                                        </div>
                                        {else}
                                        <div class="course-follow-wrapper vertical-center followcourse{$topicone['id']}"  onclick="window.location.href='{url favorite/topicadd/$tid}'">
                                            <span class="f_cname">关注</span>
                                            <span  class="btn-action-follow">
                                                <i class="fa fa-star-follow fa-star " ></i>
                                            </span>
                                        </div>
                                        {/if}
                                    </div>

                                </div>
                                <div class="course-info-body">
                                    <p  class="info-meta-data font-14">
                                        <span> {$topicone['views']} 人学过</span>
                                        <span {$topicone['likes']} 人关注</span>
                                        <span >{$topicone['articles']} 人评论</span>
                                
                                    
                                    </p>
                                    <p  class="info-course-desc">
                                        {eval echo clearhtml($topicone['describtion'],50)}
                                    </p>
                                </div>
                            </div>
                          
                        </div>
                    </div>
                </div>

                <div class="common-content wrap " 	{if is_mobile()}style="padding:10px;"{/if}>
                    <div class="tab-nav border-b">
                        <ul class="list-inline not-p">
                            <li class="active"><a href="#tab-1" data-toggle="tab" aria-expanded="true">课程详情</a></li>
                    
                          	{if !is_mobile()}  <li class=""><a href="#tab-3" data-toggle="tab" aria-expanded="false">课程评价</a></li>{/if}

                        </ul>
                    </div>
                    <!--课程相关-->
                    <div class="tab-content">
                        <div class="tab-pane fade active in" id="tab-1"><!--课程介绍-->
                 {if $topicone['price']!=0&&$haspayprice==0&&$user['uid']!=$topicone['authorid']}
  {eval echo replacewords($topicone['freeconent']);}
  
                         <div class="box_toukan ">

										{if $user['uid']==0}
											<div onclick="login()" class="thiefbox font-12" style="color:#fff;text-decoration:none;" ><i class="icon icon-lock font-12"></i> &nbsp;更多阅读需支付&nbsp;$topicone['price']&nbsp;&nbsp;{eval if ($topicone['readmode']==2) echo '财富值'; }{eval if ($topicone['readmode']==3) echo '元'; }……</div>
											{else}
											<div onclick="viewtopic($topicone['id'])"  class="thiefbox font-12" style="color:#fff;text-decoration:none;" ><i class="icon icon-lock font-12"></i> &nbsp;更多阅读需支付&nbsp;$topicone['price']&nbsp;&nbsp;{eval if ($topicone['readmode']==2) echo '财富值'; }{eval if ($topicone['readmode']==3) echo '元'; }……</div>
											{/if}


										</div>
                   {else}
                   {eval echo  replacewords($topicone['describtion']);}
           
              
                    {/if}
                        </div>
                        
                        <div class="tab-pane fade" id="tab-3"><!--评价-->
                        <div class="note" style="margin-top:20px;">
                        	{if is_mobile()} 
                        	<h2 style="font-weight:900;">课程评价</h2>
                        	<hr>
                        	{/if}
                        	      <div class="post">
                   

       <div id="comment-list" class="comment-list"><div>
            {if $user['uid']!=0}
 <form class="new-comment">
  <input type="hidden" id="artitle" value="{$topicone['title']}" />
    <input type="hidden" id="artid" value="{$topicone['id']}" />
 <a class="avatar">
 <img src="{$user['avatar']}">
 </a>
 <textarea onkeydown="return topickeydownlistener(event)"  placeholder="写下你的评论..." class="comment-area"></textarea>
 <div class="write-function-block"> 
 <a class="btn btn-send btn-cm-submit" name="comments" id="comments">发送</a> </div>
 </form>
   {else}
  <form class="new-comment"><a class="avatar"><img src="{$user['avatar']}"></a> <div class="sign-container"><a href="{url user/login}" class="btn btn-sign">登录</a> <span>后发表评论</span></div></form>

            {/if}

        </div>
        <div id="normal-comment-list" class="normal-comment-list">

        <div class="top">
        <span>{$commentrownum}条评论</span>


           </div>
           </div>
           <!----> <!---->
            <!--{if $commentlist==null}-->
            <div class="no-comment"></div>
  <center>      
           还没有人评论过~
         </center>
           

              <!--{/if}-->
          <!--{loop $commentlist $index $comment}-->
            <div id="comment-{$comment['id']}" class="comment">
            <div>
            <div class="author">
            <a href="{url user/space/$comment['authorid']}" target="_self" class="avatar">
            <img src="{$comment['avatar']}">
            </a>
            <div class="info">
            <a href="{url user/space/$comment['authorid']}" target="_self" class="name">
            {$comment['author']}
              {if $comment['author_has_vertify']!=false}<i class="fa fa-vimeo {if $comment['author_has_vertify'][0]=='0'}v_person {else}v_company {/if}  " data-toggle="tooltip" data-placement="right" title="" {if $comment['author_has_vertify'][0]=='0'}data-original-title="个人认证" {else}data-original-title="企业认证" {/if} ></i>{/if}
            </a>
            <!---->
             <div class="meta">
             <span>{eval echo ++$index;}楼 · {$comment['time']}</span>
             </div>
             </div>
             </div>
             <div class="comment-wrap">
             <p>
              {$comment['content']}
             </p>

                </div>
                </div>
                 <div class="tool-group">
             <a class="button_agree" id='{$comment['id']}'><i class="fa fa-thumbs-o-up"></i> <span>{$comment['supports']}人赞</span></a>

<a class="getcommentlist" dataid='{$comment['id']}' datatid="{$topicone['id']}"><i class="fa fa-comment"></i> <span>回复{$comment['comments']}</span></a>

                <!--{if 1==$user['grouptype'] ||$user['uid']==$comment['authorid']}-->

    <a data-placement="bottom" title="" data-toggle="tooltip" data-original-title="删除评论"   href="javascript:void(0);" onclick="deletewenzhang($comment['id'])"><i class="fa fa-bookmark-o"></i> <span>删除</span></a>
     <!--{/if}-->

                <!---->
                </div>
               <div class="sub-comment-list  hide" dataflag="0" id="articlecommentlist{$comment['id']}">
              <div class="commentlist{$comment['id']}">

              </div>
              <div class="sub-comment more-comment">
              <a class="add-comment-btn" dataid="{$comment['id']}"><i class="fa fa-edit"></i>
               <span>添加新评论</span></a>
               <!----> <!----> <!---->
               </div>
                <div class="formcomment{$comment['id']} ">
                <form class="new-comment">
                <!---->
                <textarea placeholder="写下你的评论..." class="commenttext{$comment['id']}"></textarea>
                 <div class="write-function-block">


                  <a class="btn btn-send  btn-sendartcomment" id="btnsendcomment{$comment['id']}"  dataid="{$comment['id']}" datatid="{$topicone['id']}">发送</a>

                  </div>
                  </form>
                   <!---->
                   </div>
                   </div>
                </div>
 <!--{/loop}-->
 
            
    
             </div>
             <script>
     
        	$(".add-comment-btn").click(function(){
        		var _id=$(this).attr("dataid");
        		if($(".formcomment"+_id).hasClass("hide")){
        			$(".formcomment"+_id).removeClass("hide");
        		}else{
        			$(".formcomment"+_id).addClass("hide");
        		}
        	})
        
        	 $(".button_agree").click(function(){
             var supportobj = $(this);
                     var tid = $(this).attr("id");
                     $.ajax({
                     type: "GET",
                             url:"{SITE_URL}index.php?topic/ajaxhassupport/" + tid,
                             cache: false,
                             success: function(hassupport){
                             if (hassupport != '1'){






                                     $.ajax({
                                     type: "GET",
                                             cache:false,
                                             url: "{SITE_URL}index.php?topic/ajaxaddsupport/" + tid,
                                             success: function(comments) {

                                             supportobj.find("span").html(comments+"人赞");
                                             }
                                     });
                             }else{
                            	 alert("您已经赞过");
                             }
                             }
                     });
             });
             </script>
                          
                        </div>
                        </div>
                        
                        </div>

                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-6">
            <div>
                <div class="side-img-wrapper" >
                	{if !is_mobile()}
                    <div class="side-img course-cover-img hidden-xs hidden-sm" >
                        <img src=" {$topicone['image']}" alt="{$topicone['title']}" >
                    </div>
                    {/if}
                </div>
{if $topicone}
                <div class="side-box course-teacher-info-box" style="    box-sizing: border-box;">
                    <div  class="box-header">
                        <span  class="box-title">
        课程教师
      </span>
                    </div>
                    <div class="box-body">
                        <div class="mooc-info">
                            <div class="teacher-avatar">
                                <div  class="user-avatar"  style="width: 64px; height: 64px;">
                                    <a href="{eval echo url('user/space/'.$topicone['authorid']);}" target="_blank" class="link">
                                        <img style="width: 64px; height: 64px;" src="{$member['avatar']}" class="avatar">
                                    </a>
                                    <!---->
                                </div>
                            </div>
                            <div  class="teacher-info">
                                <span  class="name">
                                    <span  class="bold">{$member['username']}</span>
                                    <!---->
                                </span>
                                <!---->
                  
                            </div>
                        </div>
                        <div class="mooc-extra-info">
                            <p class="profile">
                        {eval echo clearhtml($member['signature']);}
                    </p>
                        </div>
                    </div>
                

                </div>
{/if}

                <!--相关课程-->
                <div class="side-box course-advanced-box" style="    box-sizing: border-box;">
                    <div class="box-header" >
                        <span class="box-title" >
        相关课程
      </span>
                    </div>
                    <div class="box-body">
                        <div class="course-list" >
                        	{eval $hotcourselist=$this->getlistbysql("select id,title,views from ".$this->db->dbprefix."topic where articleclassid=$cid order by views desc ");}
                            <ul class="course-list-ul">
                    
                                {loop $hotcourselist $hotcourse}
                          
                                <li>
                                    <a href="{url topic/getone/$hotcourse['id']}" class="" >
                   {$hotcourse['title']}
                </a>
                                </li>
                               
                                {/loop}

                            </ul>
                        </div>
                    </div>
                    <div class="box-footer" >

                    </div>
                </div>

            </div>
        </div>

    </div>
</div>

</div>
{eval $hidefooter=true;}
<script>
	$("#footer").css("margin-bottom","0");
</script>
<style>
	#to_top {
    display: none;
    position: fixed;
    width: 50px;
    height: 50px;

    background-size: 100% 100%;
	}
</style>
{template footer}